import { Rule } from "./types";

export const CommentsRuleList: Rule[] = [
    {
        id: "AbsentOrWrongFileLicense",
        descEn: `This rule will report every Kotlin source file which doesn't have the required license header. The rule validates each Kotlin source and operates in two modes: if licenseTemplateIsRegex = false (or missing) the rule checks whether the input file header starts with the read text from the passed file in the licenseTemplateFile configuration option. If licenseTemplateIsRegex = true the rule matches the header with a regular expression produced from the passed template license file (defined via licenseTemplateFile configuration option).`,
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [
            {
                param: "licenseTemplateFile",
                descEn: "path to file with license header template resolved relatively to config file",
                descCn: "",
                defaultValue: "license.template",
            },
            {
                param: "licenseTemplateIsRegex",
                descEn: "whether or not the license header template is a regex template",
                descCn: "",
                defaultValue: false,
            }
        ],
        url: "https://detekt.dev/docs/rules/comments#absentorwrongfilelicense",
    },
    {
        id: "CommentOverPrivateFunction",
        descEn: `This rule reports comments and documentation that has been added to private functions. These comments get reported because they probably explain the functionality of the private function. However, private functions should be small enough and have an understandable name so that they are self-explanatory and do not need this comment in the first place.

        Instead of simply removing this comment to solve this issue prefer to split up the function into smaller functions with better names if necessary. Giving the function a better, more descriptive name can also help in solving this issue.`,
        descCn: "",
        active: false,
        debt: "20min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/comments#commentoverprivatefunction",
    },
    {
        id: "CommentOverPrivateProperty",
        descEn: `This rule reports comments and documentation above private properties. This can indicate that the property has a confusing name or is not in a small enough context to be understood. Private properties should be named in a self-explanatory way and readers of the code should be able to understand why the property exists and what purpose it solves without the comment.

        Instead of simply removing the comment to solve this issue, prefer renaming the property to a more self-explanatory name. If this property is inside a bigger class, it makes sense to refactor and split up the class. This can increase readability and make the documentation obsolete.`,
        descCn: "",
        active: false,
        debt: "20min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/comments#commentoverprivateproperty",
    },
    {
        id: "DeprecatedBlockTag",
        descEn: `This rule reports use of the @deprecated block tag in KDoc comments. Deprecation must be specified using a @Deprecated annotation as adding a @deprecated block tag in KDoc comments has no effect and is not supported. The @Deprecated annotation constructor has dedicated fields for a message and a type (warning, error, etc.). You can also use the @ReplaceWith annotation to specify how to solve the deprecation automatically via the IDE.`,
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/comments#deprecatedblocktag",
    },
    {
        id: "EndOfSentenceFormat",
        descEn: "This rule validates the end of the first sentence of a KDoc comment. It should end with proper punctuation or with a correct URL.",
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [
            {
                param: "endOfSentenceFormat",
                descEn: "regular expression which should match the end of the first sentence in the KDoc",
                descCn: "",
                defaultValue: "([.?!][ \\t\\n\\r\\f<])|([.?!:]$)",
            }
        ],
        url: "https://detekt.dev/docs/rules/comments#endofsentenceformat",
    },
    {
        id: "KDocReferencesNonPublicProperty",
        descEn: "This rule will report any KDoc comments that refer to non-public properties of a class. Clients do not need to know the implementation details.",
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/comments#kdocreferencesnonpublicproperty",
    },
    {
        id: "OutdatedDocumentation",
        descEn: "This rule will report any class, function or constructor with KDoc that does not match the declaration signature. If KDoc is not present or does not contain any @param or @property tags, rule violation will not be reported. By default, both type and value parameters need to be matched and declarations orders must be preserved. You can turn off these features using configuration options.",
        descCn: "",
        active: false,
        debt: "10min",
        paramList: [
            {
                param: "matchTypeParameters",
                descEn: "if type parameters should be matched",
                descCn: "",
                defaultValue: true,
            },
            {
                param: "matchDeclarationsOrder",
                descEn: "if the order of declarations should be preserved",
                descCn: "",
                defaultValue: true,
            },
            {
                param: "allowParamOnConstructorProperties",
                descEn: "if we allow constructor parameters to be marked as @param instead of @property",
                descCn: "",
                defaultValue: false,
            },
        ],
        url: "https://detekt.dev/docs/rules/comments#outdateddocumentation",
    },
    {
        id: "UndocumentedPublicClass",
        descEn: `This rule reports public classes, objects and interfaces which do not have the required documentation. Enable this rule if the codebase should have documentation on every public class, interface and object.

        By default, this rule also searches for nested and inner classes and objects. This default behavior can be changed with the configuration options of this rule.`,
        descCn: "",
        active: false,
        debt: "20min",
        paramList: [
            {
                param: "searchInNestedClass",
                descEn: "if nested classes should be searched",
                descCn: "",
                defaultValue: true,
            },
            {
                param: "searchInInnerClass",
                descEn: "if inner classes should be searched",
                descCn: "",
                defaultValue: true,
            },
            {
                param: "searchInInnerObject",
                descEn: "if inner objects should be searched",
                descCn: "",
                defaultValue: true,
            },
            {
                param: "searchInInnerInterface",
                descEn: "if inner interfaces should be searched",
                descCn: "",
                defaultValue: true,
            },
            {
                param: "searchInProtectedClass",
                descEn: "if protected classes should be searched",
                descCn: "",
                defaultValue: false,
            },
        ],
        url: "https://detekt.dev/docs/rules/comments#undocumentedpublicclass",
    },
    {
        id: "UndocumentedPublicFunction",
        descEn: "This rule will report any public function which does not have the required documentation. If the codebase should have documentation on all public functions enable this rule to enforce this. Overridden functions are excluded by this rule.",
        descCn: "",
        active: false,
        debt: "20min",
        paramList: [
            {
                param: "searchProtectedFunction",
                descEn: "if protected functions should be searched",
                descCn: "",
                defaultValue: false,
            }
        ],
        url: "https://detekt.dev/docs/rules/comments#undocumentedpublicfunction",
    },
    {
        id: "UndocumentedPublicProperty",
        descEn: "This rule will report any public property which does not have the required documentation. This also includes public properties defined in a primary constructor. If the codebase should have documentation on all public properties enable this rule to enforce this. Overridden properties are excluded by this rule.",
        descCn: "",
        active: false,
        debt: "20min",
        paramList: [
            {
                param: "searchProtectedProperty",
                descEn: "if protected functions should be searched",
                descCn: "",
                defaultValue: false,
            }
        ],
        url: "https://detekt.dev/docs/rules/comments#undocumentedpublicproperty",
    },
];